//
//  AppDelegate.swift
//  TXiOSDemoApp
//
//  Created by xicheng on 16/11/17.
//  Copyright © 2016年 xicheng. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
  
  var window: UIWindow?
  
  
  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    
    initConfig()
    initWindow()
    
    return true
  }
  
  
  fileprivate func initWindow() {
    let window: UIWindow = UIWindow(frame: UIScreen.main.bounds)
    self.window = window
    
    window.rootViewController = UINavigationController(rootViewController:ViewController())
    window.makeKeyAndVisible()
    
    if DEBUG_FLAG {
      let fpsLabel = TXFPSLabel(frame:CGRect(x: 5, y: kMainScreenHeight - 70, width: 0, height: 0))
      window.addSubview(fpsLabel)
      window.bringSubview(toFront: fpsLabel)
    }
  }
  
  fileprivate func initConfig() {
    
    NetworkConfig.configNetwork(WithBaseURL:"http://192.168.31.40:10000")
    NetworkConfig.configNetwork(WithProxy:AFnetworkProxyManager.sharedInstance)
    
    UINavigationBar.appearance().tintColor = UIColor.white
    UIApplication.shared.statusBarStyle = UIStatusBarStyle.lightContent
    
  }
  
  
  
  
}

